<%@page import="java.util.Map"%>
<%@page import="cts.com.dbmanager.DepositWithdrawlCash"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<style type="text/css">
#tableCSS
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
#tableCSS td, #tableCSS th 
{
font-size:1em;
border:1px solid #98bf21;
padding:3px 7px 2px 7px;
}

#tableCSS th 
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
background-color:#A7C942;
color:#ffffff;
}
#tableCSS tr.alt td 
{
color:#000000;
background-color:#EAF2D3;
}
</style>
</head>
<body>
	<center>
			<h3 style="font-family: sans-serif;">Transaction History</h3>
		<table id="tableCSS">
			<tr>
				<th width="3">Transaction Id</th>
				<th width="10">PrimaryAccountNo</th>
				<th width="10">ExternalAccountNo</th>
				<th width="2">TransactionType</th>
				<th width="7">Amount</th>
				<th width="10">Description</th>
				<th width="12">Transaction DateTime</th>
				<th width="10">CurrentBalance</th>
			</tr>
			<%
				DepositWithdrawlCash dCash = new DepositWithdrawlCash();
				String columnNames = " TransactionId,PrimaryAccountNo,ExternalAccountNo,TransactionType,Amount,Description,TransactionDateTime,CurrentBalance ";
				String tableNames = "TransactionHistory";
				String condition = " where PrimaryAccountNo='12345' order by Format(TransactionDateTime, 'mm/dd/yyyy hh:nn:ss am/pm') desc";
				Map<Integer, String[]> map = dCash.getDataFromTablesUsingCondition(
						columnNames, tableNames, condition);
				int index=0;
				for (String[] str : map.values()) {
			%>
			<%if(index%2==0){ %>
			<tr class="alt">
			<%}else{ %>
			<tr>
			<%} %>
				<%
					for (String s : str) {
				%>

				<td align="center"><%=s.equals("null")?"--":s%></td>
				<%
					}
				%>
			</tr>
			<%
				index++;
				}
			%>
		</table>
	</center>
</body>
</html>